/*
 * @Author: TalkMan
 * @Date: 2021-05-25 8:51:03
 * @LastEditTime: 2021-05-25 14:15:13
 * @LastEditors: TalkMan
 * @Description: 承租户奖罚信息接口
 */

import xjaxios from "@/api/axios";
let organizationNo = sessionStorage.getItem("organizationNo");
// let organizationNo = JSON.parse(organizationNo)
export default {
  // add(formData) {
  //   return xjaxios.post("/reward/insert", formData);
  // },
  // del(id) {
  //   return xjaxios.delete(`/reward/delete/${id}`);
  // },
  // delList(ids) {
  //   return xjaxios.post(`/reward/delList`, ids);
  // },
  // update(data) {
  //   return xjaxios.put(`/reward/update/${data.lesseeRewardId}`, data);
  // },
  // find(data) {
  //   const { category, lesseeId, page = 1, size = 10 } = data;
  //   return xjaxios.get("/reward/find", {
  //     params: {
  //       param: {
  //         entity: {
  //           category, // 信息类别
  //           lesseeId // 承租户id
  //         },
  //         page,
  //         size
  //       }
  //     }
  //   });
  // },

  // queryPageList(page, size) {
  //   return xjaxios.post(`/reward/queryPageList`, { page, size });
  // },

  /**
   * @description: 获取承租户奖罚信息 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getLessesRewardList(param) {
    return xjaxios.post(`v3/lessee/rewardIRecord/queryPageList`, param);
  },
  /**
   * @description: 新增承租户奖罚信息
   * @param {Object} formData *
   * @return {Object}
   */
  addLessesReward(formData) {
    formData.organizationNo = organizationNo;
    return xjaxios.post("v3/lessee/rewardIRecord/add", formData);
  },
  /**
   * @description: 编辑承租户奖罚信息
   * @param {Object} formData *
   * @return {Object}
   */
  editLessesReward(formData) {
    return xjaxios.post("v3/lessee/rewardIRecord/edit", formData);
    // /reward/update/{lesseeRewardId}  // put 请求
  },
  /**
   * @description: 批量删除数据
   * @param {Array} list *
   * @return {Object}
   */
  delLessesReward(list) {
    return xjaxios.post("v3/lessee/rewardIRecord/delList", {
      rewardRecordIdList: list
    });
  }
};
